<?php
if (session_id() == "") session_start(); // Initialize Session data
ob_start(); // Turn on output buffering
?>
<?php include_once "ewcfg10.php" ?>
<?php include_once "ewmysql10.php" ?>
<?php include_once "phpfn10.php" ?>
<?php include_once "clientesinfo.php" ?>
<?php include_once "usuariosinfo.php" ?>
<?php include_once "userfn10.php" ?>
<?php

//
// Page class
//

$clientes_edit = NULL; // Initialize page object first

class cclientes_edit extends cclientes {

	// Page ID
	var $PageID = 'edit';

	// Project ID
	var $ProjectID = "{51926681-1EB5-4216-A09B-8490989E5C99}";

	// Table name
	var $TableName = 'clientes';

	// Page object name
	var $PageObjName = 'clientes_edit';

	// Page name
	function PageName() {
		return ew_CurrentPage();
	}

	// Page URL
	function PageUrl() {
		$PageUrl = ew_CurrentPage() . "?";
		if ($this->UseTokenInUrl) $PageUrl .= "t=" . $this->TableVar . "&"; // Add page token
		return $PageUrl;
	}

	// Message
	function getMessage() {
		return @$_SESSION[EW_SESSION_MESSAGE];
	}

	function setMessage($v) {
		ew_AddMessage($_SESSION[EW_SESSION_MESSAGE], $v);
	}

	function getFailureMessage() {
		return @$_SESSION[EW_SESSION_FAILURE_MESSAGE];
	}

	function setFailureMessage($v) {
		ew_AddMessage($_SESSION[EW_SESSION_FAILURE_MESSAGE], $v);
	}

	function getSuccessMessage() {
		return @$_SESSION[EW_SESSION_SUCCESS_MESSAGE];
	}

	function setSuccessMessage($v) {
		ew_AddMessage($_SESSION[EW_SESSION_SUCCESS_MESSAGE], $v);
	}

	function getWarningMessage() {
		return @$_SESSION[EW_SESSION_WARNING_MESSAGE];
	}

	function setWarningMessage($v) {
		ew_AddMessage($_SESSION[EW_SESSION_WARNING_MESSAGE], $v);
	}

	// Show message
	function ShowMessage() {
		$hidden = FALSE;
		$html = "";

		// Message
		$sMessage = $this->getMessage();
		$this->Message_Showing($sMessage, "");
		if ($sMessage <> "") { // Message in Session, display
			if (!$hidden)
				$sMessage = "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>" . $sMessage;
			$html .= "<div class=\"alert alert-success ewSuccess\">" . $sMessage . "</div>";
			$_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message in Session
		}

		// Warning message
		$sWarningMessage = $this->getWarningMessage();
		$this->Message_Showing($sWarningMessage, "warning");
		if ($sWarningMessage <> "") { // Message in Session, display
			if (!$hidden)
				$sWarningMessage = "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>" . $sWarningMessage;
			$html .= "<div class=\"alert alert-warning ewWarning\">" . $sWarningMessage . "</div>";
			$_SESSION[EW_SESSION_WARNING_MESSAGE] = ""; // Clear message in Session
		}

		// Success message
		$sSuccessMessage = $this->getSuccessMessage();
		$this->Message_Showing($sSuccessMessage, "success");
		if ($sSuccessMessage <> "") { // Message in Session, display
			if (!$hidden)
				$sSuccessMessage = "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>" . $sSuccessMessage;
			$html .= "<div class=\"alert alert-success ewSuccess\">" . $sSuccessMessage . "</div>";
			$_SESSION[EW_SESSION_SUCCESS_MESSAGE] = ""; // Clear message in Session
		}

		// Failure message
		$sErrorMessage = $this->getFailureMessage();
		$this->Message_Showing($sErrorMessage, "failure");
		if ($sErrorMessage <> "") { // Message in Session, display
			if (!$hidden)
				$sErrorMessage = "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>" . $sErrorMessage;
			$html .= "<div class=\"alert alert-error ewError\">" . $sErrorMessage . "</div>";
			$_SESSION[EW_SESSION_FAILURE_MESSAGE] = ""; // Clear message in Session
		}
		echo "<table class=\"ewStdTable\"><tr><td><div class=\"ewMessageDialog\"" . (($hidden) ? " style=\"display: none;\"" : "") . ">" . $html . "</div></td></tr></table>";
	}
	var $PageHeader;
	var $PageFooter;

	// Show Page Header
	function ShowPageHeader() {
		$sHeader = $this->PageHeader;
		$this->Page_DataRendering($sHeader);
		if ($sHeader <> "") { // Header exists, display
			echo "<p>" . $sHeader . "</p>";
		}
	}

	// Show Page Footer
	function ShowPageFooter() {
		$sFooter = $this->PageFooter;
		$this->Page_DataRendered($sFooter);
		if ($sFooter <> "") { // Footer exists, display
			echo "<p>" . $sFooter . "</p>";
		}
	}

	// Validate page request
	function IsPageRequest() {
		global $objForm;
		if ($this->UseTokenInUrl) {
			if ($objForm)
				return ($this->TableVar == $objForm->GetValue("t"));
			if (@$_GET["t"] <> "")
				return ($this->TableVar == $_GET["t"]);
		} else {
			return TRUE;
		}
	}

	//
	// Page class constructor
	//
	function __construct() {
		global $conn, $Language;
		$GLOBALS["Page"] = &$this;

		// Language object
		if (!isset($Language)) $Language = new cLanguage();

		// Parent constuctor
		parent::__construct();

		// Table object (clientes)
		if (!isset($GLOBALS["clientes"]) || get_class($GLOBALS["clientes"]) == "cclientes") {
			$GLOBALS["clientes"] = &$this;
			$GLOBALS["Table"] = &$GLOBALS["clientes"];
		}

		// Table object (usuarios)
		if (!isset($GLOBALS['usuarios'])) $GLOBALS['usuarios'] = new cusuarios();

		// Page ID
		if (!defined("EW_PAGE_ID"))
			define("EW_PAGE_ID", 'edit', TRUE);

		// Table name (for backward compatibility)
		if (!defined("EW_TABLE_NAME"))
			define("EW_TABLE_NAME", 'clientes', TRUE);

		// Start timer
		if (!isset($GLOBALS["gTimer"])) $GLOBALS["gTimer"] = new cTimer();

		// Open connection
		if (!isset($conn)) $conn = ew_Connect();
	}

	// 
	//  Page_Init
	//
	function Page_Init() {
		global $gsExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm;

		// Security
		$Security = new cAdvancedSecurity();
		if (!$Security->IsLoggedIn()) $Security->AutoLogin();
		if (!$Security->IsLoggedIn()) {
			$Security->SaveLastUrl();
			$this->Page_Terminate("login.php");
		}

		// Create form object
		$objForm = new cFormObj();
		$this->CurrentAction = (@$_GET["a"] <> "") ? $_GET["a"] : @$_POST["a_list"]; // Set up current action
		$this->id->Visible = !$this->IsAdd() && !$this->IsCopy() && !$this->IsGridAdd();

		// Global Page Loading event (in userfn*.php)
		Page_Loading();

		// Page Load event
		$this->Page_Load();
	}

	//
	// Page_Terminate
	//
	function Page_Terminate($url = "") {
		global $conn;

		// Page Unload event
		$this->Page_Unload();

		// Global Page Unloaded event (in userfn*.php)
		Page_Unloaded();
		$this->Page_Redirecting($url);

		 // Close connection
		$conn->Close();

		// Go to URL if specified
		if ($url <> "") {
			if (!EW_DEBUG_ENABLED && ob_get_length())
				ob_end_clean();
			header("Location: " . $url);
		}
		exit();
	}
	var $DbMasterFilter;
	var $DbDetailFilter;

	// 
	// Page main
	//
	function Page_Main() {
		global $objForm, $Language, $gsFormError;

		// Load key from QueryString
		if (@$_GET["id"] <> "") {
			$this->id->setQueryStringValue($_GET["id"]);
		}

		// Set up Breadcrumb
		$this->SetupBreadcrumb();

		// Process form if post back
		if (@$_POST["a_edit"] <> "") {
			$this->CurrentAction = $_POST["a_edit"]; // Get action code
			$this->LoadFormValues(); // Get form values
		} else {
			$this->CurrentAction = "I"; // Default action is display
		}

		// Check if valid key
		if ($this->id->CurrentValue == "")
			$this->Page_Terminate("clienteslist.php"); // Invalid key, return to list

		// Validate form if post back
		if (@$_POST["a_edit"] <> "") {
			if (!$this->ValidateForm()) {
				$this->CurrentAction = ""; // Form error, reset action
				$this->setFailureMessage($gsFormError);
				$this->EventCancelled = TRUE; // Event cancelled
				$this->RestoreFormValues();
			}
		}
		switch ($this->CurrentAction) {
			case "I": // Get a record to display
				if (!$this->LoadRow()) { // Load record based on key
					if ($this->getFailureMessage() == "") $this->setFailureMessage($Language->Phrase("NoRecord")); // No record found
					$this->Page_Terminate("clienteslist.php"); // No matching record, return to list
				}
				break;
			Case "U": // Update
				$this->SendEmail = TRUE; // Send email on update success
				if ($this->EditRow()) { // Update record based on key
					if ($this->getSuccessMessage() == "")
						$this->setSuccessMessage($Language->Phrase("UpdateSuccess")); // Update success
					$sReturnUrl = $this->getReturnUrl();
					$this->Page_Terminate($sReturnUrl); // Return to caller
				} else {
					$this->EventCancelled = TRUE; // Event cancelled
					$this->RestoreFormValues(); // Restore form values if update failed
				}
		}

		// Render the record
		$this->RowType = EW_ROWTYPE_EDIT; // Render as Edit
		$this->ResetAttrs();
		$this->RenderRow();
	}

	// Set up starting record parameters
	function SetUpStartRec() {
		if ($this->DisplayRecs == 0)
			return;
		if ($this->IsPageRequest()) { // Validate request
			if (@$_GET[EW_TABLE_START_REC] <> "") { // Check for "start" parameter
				$this->StartRec = $_GET[EW_TABLE_START_REC];
				$this->setStartRecordNumber($this->StartRec);
			} elseif (@$_GET[EW_TABLE_PAGE_NO] <> "") {
				$PageNo = $_GET[EW_TABLE_PAGE_NO];
				if (is_numeric($PageNo)) {
					$this->StartRec = ($PageNo-1)*$this->DisplayRecs+1;
					if ($this->StartRec <= 0) {
						$this->StartRec = 1;
					} elseif ($this->StartRec >= intval(($this->TotalRecs-1)/$this->DisplayRecs)*$this->DisplayRecs+1) {
						$this->StartRec = intval(($this->TotalRecs-1)/$this->DisplayRecs)*$this->DisplayRecs+1;
					}
					$this->setStartRecordNumber($this->StartRec);
				}
			}
		}
		$this->StartRec = $this->getStartRecordNumber();

		// Check if correct start record counter
		if (!is_numeric($this->StartRec) || $this->StartRec == "") { // Avoid invalid start record counter
			$this->StartRec = 1; // Reset start record counter
			$this->setStartRecordNumber($this->StartRec);
		} elseif (intval($this->StartRec) > intval($this->TotalRecs)) { // Avoid starting record > total records
			$this->StartRec = intval(($this->TotalRecs-1)/$this->DisplayRecs)*$this->DisplayRecs+1; // Point to last page first record
			$this->setStartRecordNumber($this->StartRec);
		} elseif (($this->StartRec-1) % $this->DisplayRecs <> 0) {
			$this->StartRec = intval(($this->StartRec-1)/$this->DisplayRecs)*$this->DisplayRecs+1; // Point to page boundary
			$this->setStartRecordNumber($this->StartRec);
		}
	}

	// Get upload files
	function GetUploadFiles() {
		global $objForm;

		// Get upload data
	}

	// Load form values
	function LoadFormValues() {

		// Load from form
		global $objForm;
		if (!$this->id->FldIsDetailKey)
			$this->id->setFormValue($objForm->GetValue("x_id"));
		if (!$this->Nombre->FldIsDetailKey) {
			$this->Nombre->setFormValue($objForm->GetValue("x_Nombre"));
		}
		if (!$this->Apellido->FldIsDetailKey) {
			$this->Apellido->setFormValue($objForm->GetValue("x_Apellido"));
		}
		if (!$this->Dni->FldIsDetailKey) {
			$this->Dni->setFormValue($objForm->GetValue("x_Dni"));
		}
		if (!$this->Calle->FldIsDetailKey) {
			$this->Calle->setFormValue($objForm->GetValue("x_Calle"));
		}
		if (!$this->Numero->FldIsDetailKey) {
			$this->Numero->setFormValue($objForm->GetValue("x_Numero"));
		}
		if (!$this->Piso->FldIsDetailKey) {
			$this->Piso->setFormValue($objForm->GetValue("x_Piso"));
		}
		if (!$this->Dpto->FldIsDetailKey) {
			$this->Dpto->setFormValue($objForm->GetValue("x_Dpto"));
		}
		if (!$this->EntreCalles->FldIsDetailKey) {
			$this->EntreCalles->setFormValue($objForm->GetValue("x_EntreCalles"));
		}
		if (!$this->TelCel->FldIsDetailKey) {
			$this->TelCel->setFormValue($objForm->GetValue("x_TelCel"));
		}
		if (!$this->TelFijo->FldIsDetailKey) {
			$this->TelFijo->setFormValue($objForm->GetValue("x_TelFijo"));
		}
		if (!$this->TelVecino->FldIsDetailKey) {
			$this->TelVecino->setFormValue($objForm->GetValue("x_TelVecino"));
		}
		if (!$this->_Email->FldIsDetailKey) {
			$this->_Email->setFormValue($objForm->GetValue("x__Email"));
		}
		if (!$this->FechaNacimiento->FldIsDetailKey) {
			$this->FechaNacimiento->setFormValue($objForm->GetValue("x_FechaNacimiento"));
			$this->FechaNacimiento->CurrentValue = ew_UnFormatDateTime($this->FechaNacimiento->CurrentValue, 7);
		}
		if (!$this->Provincia->FldIsDetailKey) {
			$this->Provincia->setFormValue($objForm->GetValue("x_Provincia"));
		}
		if (!$this->Localidad->FldIsDetailKey) {
			$this->Localidad->setFormValue($objForm->GetValue("x_Localidad"));
		}
		if (!$this->CP->FldIsDetailKey) {
			$this->CP->setFormValue($objForm->GetValue("x_CP"));
		}
		if (!$this->NivelMorosidad->FldIsDetailKey) {
			$this->NivelMorosidad->setFormValue($objForm->GetValue("x_NivelMorosidad"));
		}
		if (!$this->LimiteCredito->FldIsDetailKey) {
			$this->LimiteCredito->setFormValue($objForm->GetValue("x_LimiteCredito"));
		}
		if (!$this->LimiteContado->FldIsDetailKey) {
			$this->LimiteContado->setFormValue($objForm->GetValue("x_LimiteContado"));
		}
		if (!$this->TipoCliente->FldIsDetailKey) {
			$this->TipoCliente->setFormValue($objForm->GetValue("x_TipoCliente"));
		}
		if (!$this->Habilitacion->FldIsDetailKey) {
			$this->Habilitacion->setFormValue($objForm->GetValue("x_Habilitacion"));
		}
		if (!$this->IngresoMensual->FldIsDetailKey) {
			$this->IngresoMensual->setFormValue($objForm->GetValue("x_IngresoMensual"));
		}
		if (!$this->CodigoAutorizacionSMS->FldIsDetailKey) {
			$this->CodigoAutorizacionSMS->setFormValue($objForm->GetValue("x_CodigoAutorizacionSMS"));
		}
	}

	// Restore form values
	function RestoreFormValues() {
		global $objForm;
		$this->LoadRow();
		$this->id->CurrentValue = $this->id->FormValue;
		$this->Nombre->CurrentValue = $this->Nombre->FormValue;
		$this->Apellido->CurrentValue = $this->Apellido->FormValue;
		$this->Dni->CurrentValue = $this->Dni->FormValue;
		$this->Calle->CurrentValue = $this->Calle->FormValue;
		$this->Numero->CurrentValue = $this->Numero->FormValue;
		$this->Piso->CurrentValue = $this->Piso->FormValue;
		$this->Dpto->CurrentValue = $this->Dpto->FormValue;
		$this->EntreCalles->CurrentValue = $this->EntreCalles->FormValue;
		$this->TelCel->CurrentValue = $this->TelCel->FormValue;
		$this->TelFijo->CurrentValue = $this->TelFijo->FormValue;
		$this->TelVecino->CurrentValue = $this->TelVecino->FormValue;
		$this->_Email->CurrentValue = $this->_Email->FormValue;
		$this->FechaNacimiento->CurrentValue = $this->FechaNacimiento->FormValue;
		$this->FechaNacimiento->CurrentValue = ew_UnFormatDateTime($this->FechaNacimiento->CurrentValue, 7);
		$this->Provincia->CurrentValue = $this->Provincia->FormValue;
		$this->Localidad->CurrentValue = $this->Localidad->FormValue;
		$this->CP->CurrentValue = $this->CP->FormValue;
		$this->NivelMorosidad->CurrentValue = $this->NivelMorosidad->FormValue;
		$this->LimiteCredito->CurrentValue = $this->LimiteCredito->FormValue;
		$this->LimiteContado->CurrentValue = $this->LimiteContado->FormValue;
		$this->TipoCliente->CurrentValue = $this->TipoCliente->FormValue;
		$this->Habilitacion->CurrentValue = $this->Habilitacion->FormValue;
		$this->IngresoMensual->CurrentValue = $this->IngresoMensual->FormValue;
		$this->CodigoAutorizacionSMS->CurrentValue = $this->CodigoAutorizacionSMS->FormValue;
	}

	// Load row based on key values
	function LoadRow() {
		global $conn, $Security, $Language;
		$sFilter = $this->KeyFilter();

		// Call Row Selecting event
		$this->Row_Selecting($sFilter);

		// Load SQL based on filter
		$this->CurrentFilter = $sFilter;
		$sSql = $this->SQL();
		$res = FALSE;
		$rs = ew_LoadRecordset($sSql);
		if ($rs && !$rs->EOF) {
			$res = TRUE;
			$this->LoadRowValues($rs); // Load row values
			$rs->Close();
		}
		return $res;
	}

	// Load row values from recordset
	function LoadRowValues(&$rs) {
		global $conn;
		if (!$rs || $rs->EOF) return;

		// Call Row Selected event
		$row = &$rs->fields;
		$this->Row_Selected($row);
		$this->id->setDbValue($rs->fields('id'));
		$this->Nombre->setDbValue($rs->fields('Nombre'));
		$this->Apellido->setDbValue($rs->fields('Apellido'));
		$this->Dni->setDbValue($rs->fields('Dni'));
		$this->Calle->setDbValue($rs->fields('Calle'));
		$this->Numero->setDbValue($rs->fields('Numero'));
		$this->Piso->setDbValue($rs->fields('Piso'));
		$this->Dpto->setDbValue($rs->fields('Dpto'));
		$this->EntreCalles->setDbValue($rs->fields('EntreCalles'));
		$this->TelCel->setDbValue($rs->fields('TelCel'));
		$this->TelFijo->setDbValue($rs->fields('TelFijo'));
		$this->TelVecino->setDbValue($rs->fields('TelVecino'));
		$this->_Email->setDbValue($rs->fields('Email'));
		$this->FechaNacimiento->setDbValue($rs->fields('FechaNacimiento'));
		$this->Provincia->setDbValue($rs->fields('Provincia'));
		$this->Localidad->setDbValue($rs->fields('Localidad'));
		$this->CP->setDbValue($rs->fields('CP'));
		$this->NivelMorosidad->setDbValue($rs->fields('NivelMorosidad'));
		$this->LimiteCredito->setDbValue($rs->fields('LimiteCredito'));
		$this->LimiteContado->setDbValue($rs->fields('LimiteContado'));
		$this->TipoCliente->setDbValue($rs->fields('TipoCliente'));
		$this->Habilitacion->setDbValue($rs->fields('Habilitacion'));
		$this->IngresoMensual->setDbValue($rs->fields('IngresoMensual'));
		$this->CodigoAutorizacionSMS->setDbValue($rs->fields('CodigoAutorizacionSMS'));
	}

	// Load DbValue from recordset
	function LoadDbValues(&$rs) {
		if (!$rs || !is_array($rs) && $rs->EOF) return;
		$row = is_array($rs) ? $rs : $rs->fields;
		$this->id->DbValue = $row['id'];
		$this->Nombre->DbValue = $row['Nombre'];
		$this->Apellido->DbValue = $row['Apellido'];
		$this->Dni->DbValue = $row['Dni'];
		$this->Calle->DbValue = $row['Calle'];
		$this->Numero->DbValue = $row['Numero'];
		$this->Piso->DbValue = $row['Piso'];
		$this->Dpto->DbValue = $row['Dpto'];
		$this->EntreCalles->DbValue = $row['EntreCalles'];
		$this->TelCel->DbValue = $row['TelCel'];
		$this->TelFijo->DbValue = $row['TelFijo'];
		$this->TelVecino->DbValue = $row['TelVecino'];
		$this->_Email->DbValue = $row['Email'];
		$this->FechaNacimiento->DbValue = $row['FechaNacimiento'];
		$this->Provincia->DbValue = $row['Provincia'];
		$this->Localidad->DbValue = $row['Localidad'];
		$this->CP->DbValue = $row['CP'];
		$this->NivelMorosidad->DbValue = $row['NivelMorosidad'];
		$this->LimiteCredito->DbValue = $row['LimiteCredito'];
		$this->LimiteContado->DbValue = $row['LimiteContado'];
		$this->TipoCliente->DbValue = $row['TipoCliente'];
		$this->Habilitacion->DbValue = $row['Habilitacion'];
		$this->IngresoMensual->DbValue = $row['IngresoMensual'];
		$this->CodigoAutorizacionSMS->DbValue = $row['CodigoAutorizacionSMS'];
	}

	// Render row values based on field settings
	function RenderRow() {
		global $conn, $Security, $Language;
		global $gsLanguage;

		// Initialize URLs
		// Convert decimal values if posted back

		if ($this->LimiteCredito->FormValue == $this->LimiteCredito->CurrentValue && is_numeric(ew_StrToFloat($this->LimiteCredito->CurrentValue)))
			$this->LimiteCredito->CurrentValue = ew_StrToFloat($this->LimiteCredito->CurrentValue);

		// Convert decimal values if posted back
		if ($this->LimiteContado->FormValue == $this->LimiteContado->CurrentValue && is_numeric(ew_StrToFloat($this->LimiteContado->CurrentValue)))
			$this->LimiteContado->CurrentValue = ew_StrToFloat($this->LimiteContado->CurrentValue);

		// Convert decimal values if posted back
		if ($this->IngresoMensual->FormValue == $this->IngresoMensual->CurrentValue && is_numeric(ew_StrToFloat($this->IngresoMensual->CurrentValue)))
			$this->IngresoMensual->CurrentValue = ew_StrToFloat($this->IngresoMensual->CurrentValue);

		// Convert decimal values if posted back
		if ($this->CodigoAutorizacionSMS->FormValue == $this->CodigoAutorizacionSMS->CurrentValue && is_numeric(ew_StrToFloat($this->CodigoAutorizacionSMS->CurrentValue)))
			$this->CodigoAutorizacionSMS->CurrentValue = ew_StrToFloat($this->CodigoAutorizacionSMS->CurrentValue);

		// Call Row_Rendering event
		$this->Row_Rendering();

		// Common render codes for all row types
		// id
		// Nombre
		// Apellido
		// Dni
		// Calle
		// Numero
		// Piso
		// Dpto
		// EntreCalles
		// TelCel
		// TelFijo
		// TelVecino
		// Email
		// FechaNacimiento
		// Provincia
		// Localidad
		// CP
		// NivelMorosidad
		// LimiteCredito
		// LimiteContado
		// TipoCliente
		// Habilitacion
		// IngresoMensual
		// CodigoAutorizacionSMS

		if ($this->RowType == EW_ROWTYPE_VIEW) { // View row

			// id
			$this->id->ViewValue = $this->id->CurrentValue;
			$this->id->ViewCustomAttributes = "";

			// Nombre
			$this->Nombre->ViewValue = $this->Nombre->CurrentValue;
			$this->Nombre->ViewCustomAttributes = "";

			// Apellido
			$this->Apellido->ViewValue = $this->Apellido->CurrentValue;
			$this->Apellido->ViewCustomAttributes = "";

			// Dni
			$this->Dni->ViewValue = $this->Dni->CurrentValue;
			$this->Dni->ViewCustomAttributes = "";

			// Calle
			$this->Calle->ViewValue = $this->Calle->CurrentValue;
			$this->Calle->ViewCustomAttributes = "";

			// Numero
			$this->Numero->ViewValue = $this->Numero->CurrentValue;
			$this->Numero->ViewCustomAttributes = "";

			// Piso
			$this->Piso->ViewValue = $this->Piso->CurrentValue;
			$this->Piso->ViewCustomAttributes = "";

			// Dpto
			$this->Dpto->ViewValue = $this->Dpto->CurrentValue;
			$this->Dpto->ViewCustomAttributes = "";

			// EntreCalles
			$this->EntreCalles->ViewValue = $this->EntreCalles->CurrentValue;
			$this->EntreCalles->ViewCustomAttributes = "";

			// TelCel
			$this->TelCel->ViewValue = $this->TelCel->CurrentValue;
			$this->TelCel->ViewCustomAttributes = "";

			// TelFijo
			$this->TelFijo->ViewValue = $this->TelFijo->CurrentValue;
			$this->TelFijo->ViewCustomAttributes = "";

			// TelVecino
			$this->TelVecino->ViewValue = $this->TelVecino->CurrentValue;
			$this->TelVecino->ViewCustomAttributes = "";

			// Email
			$this->_Email->ViewValue = $this->_Email->CurrentValue;
			$this->_Email->ViewCustomAttributes = "";

			// FechaNacimiento
			$this->FechaNacimiento->ViewValue = $this->FechaNacimiento->CurrentValue;
			$this->FechaNacimiento->ViewValue = ew_FormatDateTime($this->FechaNacimiento->ViewValue, 7);
			$this->FechaNacimiento->ViewCustomAttributes = "";

			// Provincia
			$this->Provincia->ViewValue = $this->Provincia->CurrentValue;
			$this->Provincia->ViewCustomAttributes = "";

			// Localidad
			$this->Localidad->ViewValue = $this->Localidad->CurrentValue;
			$this->Localidad->ViewCustomAttributes = "";

			// CP
			$this->CP->ViewValue = $this->CP->CurrentValue;
			$this->CP->ViewCustomAttributes = "";

			// NivelMorosidad
			$this->NivelMorosidad->ViewValue = $this->NivelMorosidad->CurrentValue;
			$this->NivelMorosidad->ViewCustomAttributes = "";

			// LimiteCredito
			$this->LimiteCredito->ViewValue = $this->LimiteCredito->CurrentValue;
			$this->LimiteCredito->ViewCustomAttributes = "";

			// LimiteContado
			$this->LimiteContado->ViewValue = $this->LimiteContado->CurrentValue;
			$this->LimiteContado->ViewCustomAttributes = "";

			// TipoCliente
			$this->TipoCliente->ViewValue = $this->TipoCliente->CurrentValue;
			$this->TipoCliente->ViewCustomAttributes = "";

			// Habilitacion
			$this->Habilitacion->ViewValue = $this->Habilitacion->CurrentValue;
			$this->Habilitacion->ViewCustomAttributes = "";

			// IngresoMensual
			$this->IngresoMensual->ViewValue = $this->IngresoMensual->CurrentValue;
			$this->IngresoMensual->ViewCustomAttributes = "";

			// CodigoAutorizacionSMS
			$this->CodigoAutorizacionSMS->ViewValue = $this->CodigoAutorizacionSMS->CurrentValue;
			$this->CodigoAutorizacionSMS->ViewCustomAttributes = "";

			// id
			$this->id->LinkCustomAttributes = "";
			$this->id->HrefValue = "";
			$this->id->TooltipValue = "";

			// Nombre
			$this->Nombre->LinkCustomAttributes = "";
			$this->Nombre->HrefValue = "";
			$this->Nombre->TooltipValue = "";

			// Apellido
			$this->Apellido->LinkCustomAttributes = "";
			$this->Apellido->HrefValue = "";
			$this->Apellido->TooltipValue = "";

			// Dni
			$this->Dni->LinkCustomAttributes = "";
			$this->Dni->HrefValue = "";
			$this->Dni->TooltipValue = "";

			// Calle
			$this->Calle->LinkCustomAttributes = "";
			$this->Calle->HrefValue = "";
			$this->Calle->TooltipValue = "";

			// Numero
			$this->Numero->LinkCustomAttributes = "";
			$this->Numero->HrefValue = "";
			$this->Numero->TooltipValue = "";

			// Piso
			$this->Piso->LinkCustomAttributes = "";
			$this->Piso->HrefValue = "";
			$this->Piso->TooltipValue = "";

			// Dpto
			$this->Dpto->LinkCustomAttributes = "";
			$this->Dpto->HrefValue = "";
			$this->Dpto->TooltipValue = "";

			// EntreCalles
			$this->EntreCalles->LinkCustomAttributes = "";
			$this->EntreCalles->HrefValue = "";
			$this->EntreCalles->TooltipValue = "";

			// TelCel
			$this->TelCel->LinkCustomAttributes = "";
			$this->TelCel->HrefValue = "";
			$this->TelCel->TooltipValue = "";

			// TelFijo
			$this->TelFijo->LinkCustomAttributes = "";
			$this->TelFijo->HrefValue = "";
			$this->TelFijo->TooltipValue = "";

			// TelVecino
			$this->TelVecino->LinkCustomAttributes = "";
			$this->TelVecino->HrefValue = "";
			$this->TelVecino->TooltipValue = "";

			// Email
			$this->_Email->LinkCustomAttributes = "";
			$this->_Email->HrefValue = "";
			$this->_Email->TooltipValue = "";

			// FechaNacimiento
			$this->FechaNacimiento->LinkCustomAttributes = "";
			$this->FechaNacimiento->HrefValue = "";
			$this->FechaNacimiento->TooltipValue = "";

			// Provincia
			$this->Provincia->LinkCustomAttributes = "";
			$this->Provincia->HrefValue = "";
			$this->Provincia->TooltipValue = "";

			// Localidad
			$this->Localidad->LinkCustomAttributes = "";
			$this->Localidad->HrefValue = "";
			$this->Localidad->TooltipValue = "";

			// CP
			$this->CP->LinkCustomAttributes = "";
			$this->CP->HrefValue = "";
			$this->CP->TooltipValue = "";

			// NivelMorosidad
			$this->NivelMorosidad->LinkCustomAttributes = "";
			$this->NivelMorosidad->HrefValue = "";
			$this->NivelMorosidad->TooltipValue = "";

			// LimiteCredito
			$this->LimiteCredito->LinkCustomAttributes = "";
			$this->LimiteCredito->HrefValue = "";
			$this->LimiteCredito->TooltipValue = "";

			// LimiteContado
			$this->LimiteContado->LinkCustomAttributes = "";
			$this->LimiteContado->HrefValue = "";
			$this->LimiteContado->TooltipValue = "";

			// TipoCliente
			$this->TipoCliente->LinkCustomAttributes = "";
			$this->TipoCliente->HrefValue = "";
			$this->TipoCliente->TooltipValue = "";

			// Habilitacion
			$this->Habilitacion->LinkCustomAttributes = "";
			$this->Habilitacion->HrefValue = "";
			$this->Habilitacion->TooltipValue = "";

			// IngresoMensual
			$this->IngresoMensual->LinkCustomAttributes = "";
			$this->IngresoMensual->HrefValue = "";
			$this->IngresoMensual->TooltipValue = "";

			// CodigoAutorizacionSMS
			$this->CodigoAutorizacionSMS->LinkCustomAttributes = "";
			$this->CodigoAutorizacionSMS->HrefValue = "";
			$this->CodigoAutorizacionSMS->TooltipValue = "";
		} elseif ($this->RowType == EW_ROWTYPE_EDIT) { // Edit row

			// id
			$this->id->EditCustomAttributes = "";
			$this->id->EditValue = $this->id->CurrentValue;
			$this->id->ViewCustomAttributes = "";

			// Nombre
			$this->Nombre->EditCustomAttributes = "";
			$this->Nombre->EditValue = ew_HtmlEncode($this->Nombre->CurrentValue);
			$this->Nombre->PlaceHolder = ew_RemoveHtml($this->Nombre->FldCaption());

			// Apellido
			$this->Apellido->EditCustomAttributes = "";
			$this->Apellido->EditValue = ew_HtmlEncode($this->Apellido->CurrentValue);
			$this->Apellido->PlaceHolder = ew_RemoveHtml($this->Apellido->FldCaption());

			// Dni
			$this->Dni->EditCustomAttributes = "";
			$this->Dni->EditValue = ew_HtmlEncode($this->Dni->CurrentValue);
			$this->Dni->PlaceHolder = ew_RemoveHtml($this->Dni->FldCaption());

			// Calle
			$this->Calle->EditCustomAttributes = "";
			$this->Calle->EditValue = ew_HtmlEncode($this->Calle->CurrentValue);
			$this->Calle->PlaceHolder = ew_RemoveHtml($this->Calle->FldCaption());

			// Numero
			$this->Numero->EditCustomAttributes = "";
			$this->Numero->EditValue = ew_HtmlEncode($this->Numero->CurrentValue);
			$this->Numero->PlaceHolder = ew_RemoveHtml($this->Numero->FldCaption());

			// Piso
			$this->Piso->EditCustomAttributes = "";
			$this->Piso->EditValue = ew_HtmlEncode($this->Piso->CurrentValue);
			$this->Piso->PlaceHolder = ew_RemoveHtml($this->Piso->FldCaption());

			// Dpto
			$this->Dpto->EditCustomAttributes = "";
			$this->Dpto->EditValue = ew_HtmlEncode($this->Dpto->CurrentValue);
			$this->Dpto->PlaceHolder = ew_RemoveHtml($this->Dpto->FldCaption());

			// EntreCalles
			$this->EntreCalles->EditCustomAttributes = "";
			$this->EntreCalles->EditValue = ew_HtmlEncode($this->EntreCalles->CurrentValue);
			$this->EntreCalles->PlaceHolder = ew_RemoveHtml($this->EntreCalles->FldCaption());

			// TelCel
			$this->TelCel->EditCustomAttributes = "";
			$this->TelCel->EditValue = ew_HtmlEncode($this->TelCel->CurrentValue);
			$this->TelCel->PlaceHolder = ew_RemoveHtml($this->TelCel->FldCaption());

			// TelFijo
			$this->TelFijo->EditCustomAttributes = "";
			$this->TelFijo->EditValue = ew_HtmlEncode($this->TelFijo->CurrentValue);
			$this->TelFijo->PlaceHolder = ew_RemoveHtml($this->TelFijo->FldCaption());

			// TelVecino
			$this->TelVecino->EditCustomAttributes = "";
			$this->TelVecino->EditValue = ew_HtmlEncode($this->TelVecino->CurrentValue);
			$this->TelVecino->PlaceHolder = ew_RemoveHtml($this->TelVecino->FldCaption());

			// Email
			$this->_Email->EditCustomAttributes = "";
			$this->_Email->EditValue = ew_HtmlEncode($this->_Email->CurrentValue);
			$this->_Email->PlaceHolder = ew_RemoveHtml($this->_Email->FldCaption());

			// FechaNacimiento
			$this->FechaNacimiento->EditCustomAttributes = "";
			$this->FechaNacimiento->EditValue = ew_HtmlEncode(ew_FormatDateTime($this->FechaNacimiento->CurrentValue, 7));
			$this->FechaNacimiento->PlaceHolder = ew_RemoveHtml($this->FechaNacimiento->FldCaption());

			// Provincia
			$this->Provincia->EditCustomAttributes = "";
			$this->Provincia->EditValue = ew_HtmlEncode($this->Provincia->CurrentValue);
			$this->Provincia->PlaceHolder = ew_RemoveHtml($this->Provincia->FldCaption());

			// Localidad
			$this->Localidad->EditCustomAttributes = "";
			$this->Localidad->EditValue = ew_HtmlEncode($this->Localidad->CurrentValue);
			$this->Localidad->PlaceHolder = ew_RemoveHtml($this->Localidad->FldCaption());

			// CP
			$this->CP->EditCustomAttributes = "";
			$this->CP->EditValue = ew_HtmlEncode($this->CP->CurrentValue);
			$this->CP->PlaceHolder = ew_RemoveHtml($this->CP->FldCaption());

			// NivelMorosidad
			$this->NivelMorosidad->EditCustomAttributes = "";
			$this->NivelMorosidad->EditValue = ew_HtmlEncode($this->NivelMorosidad->CurrentValue);
			$this->NivelMorosidad->PlaceHolder = ew_RemoveHtml($this->NivelMorosidad->FldCaption());

			// LimiteCredito
			$this->LimiteCredito->EditCustomAttributes = "";
			$this->LimiteCredito->EditValue = ew_HtmlEncode($this->LimiteCredito->CurrentValue);
			$this->LimiteCredito->PlaceHolder = ew_RemoveHtml($this->LimiteCredito->FldCaption());
			if (strval($this->LimiteCredito->EditValue) <> "" && is_numeric($this->LimiteCredito->EditValue)) $this->LimiteCredito->EditValue = ew_FormatNumber($this->LimiteCredito->EditValue, -2, -1, -2, 0);

			// LimiteContado
			$this->LimiteContado->EditCustomAttributes = "";
			$this->LimiteContado->EditValue = ew_HtmlEncode($this->LimiteContado->CurrentValue);
			$this->LimiteContado->PlaceHolder = ew_RemoveHtml($this->LimiteContado->FldCaption());
			if (strval($this->LimiteContado->EditValue) <> "" && is_numeric($this->LimiteContado->EditValue)) $this->LimiteContado->EditValue = ew_FormatNumber($this->LimiteContado->EditValue, -2, -1, -2, 0);

			// TipoCliente
			$this->TipoCliente->EditCustomAttributes = "";
			$this->TipoCliente->EditValue = ew_HtmlEncode($this->TipoCliente->CurrentValue);
			$this->TipoCliente->PlaceHolder = ew_RemoveHtml($this->TipoCliente->FldCaption());

			// Habilitacion
			$this->Habilitacion->EditCustomAttributes = "";
			$this->Habilitacion->EditValue = ew_HtmlEncode($this->Habilitacion->CurrentValue);
			$this->Habilitacion->PlaceHolder = ew_RemoveHtml($this->Habilitacion->FldCaption());

			// IngresoMensual
			$this->IngresoMensual->EditCustomAttributes = "";
			$this->IngresoMensual->EditValue = ew_HtmlEncode($this->IngresoMensual->CurrentValue);
			$this->IngresoMensual->PlaceHolder = ew_RemoveHtml($this->IngresoMensual->FldCaption());
			if (strval($this->IngresoMensual->EditValue) <> "" && is_numeric($this->IngresoMensual->EditValue)) $this->IngresoMensual->EditValue = ew_FormatNumber($this->IngresoMensual->EditValue, -2, -1, -2, 0);

			// CodigoAutorizacionSMS
			$this->CodigoAutorizacionSMS->EditCustomAttributes = "";
			$this->CodigoAutorizacionSMS->EditValue = ew_HtmlEncode($this->CodigoAutorizacionSMS->CurrentValue);
			$this->CodigoAutorizacionSMS->PlaceHolder = ew_RemoveHtml($this->CodigoAutorizacionSMS->FldCaption());
			if (strval($this->CodigoAutorizacionSMS->EditValue) <> "" && is_numeric($this->CodigoAutorizacionSMS->EditValue)) $this->CodigoAutorizacionSMS->EditValue = ew_FormatNumber($this->CodigoAutorizacionSMS->EditValue, -2, -1, -2, 0);

			// Edit refer script
			// id

			$this->id->HrefValue = "";

			// Nombre
			$this->Nombre->HrefValue = "";

			// Apellido
			$this->Apellido->HrefValue = "";

			// Dni
			$this->Dni->HrefValue = "";

			// Calle
			$this->Calle->HrefValue = "";

			// Numero
			$this->Numero->HrefValue = "";

			// Piso
			$this->Piso->HrefValue = "";

			// Dpto
			$this->Dpto->HrefValue = "";

			// EntreCalles
			$this->EntreCalles->HrefValue = "";

			// TelCel
			$this->TelCel->HrefValue = "";

			// TelFijo
			$this->TelFijo->HrefValue = "";

			// TelVecino
			$this->TelVecino->HrefValue = "";

			// Email
			$this->_Email->HrefValue = "";

			// FechaNacimiento
			$this->FechaNacimiento->HrefValue = "";

			// Provincia
			$this->Provincia->HrefValue = "";

			// Localidad
			$this->Localidad->HrefValue = "";

			// CP
			$this->CP->HrefValue = "";

			// NivelMorosidad
			$this->NivelMorosidad->HrefValue = "";

			// LimiteCredito
			$this->LimiteCredito->HrefValue = "";

			// LimiteContado
			$this->LimiteContado->HrefValue = "";

			// TipoCliente
			$this->TipoCliente->HrefValue = "";

			// Habilitacion
			$this->Habilitacion->HrefValue = "";

			// IngresoMensual
			$this->IngresoMensual->HrefValue = "";

			// CodigoAutorizacionSMS
			$this->CodigoAutorizacionSMS->HrefValue = "";
		}
		if ($this->RowType == EW_ROWTYPE_ADD ||
			$this->RowType == EW_ROWTYPE_EDIT ||
			$this->RowType == EW_ROWTYPE_SEARCH) { // Add / Edit / Search row
			$this->SetupFieldTitles();
		}

		// Call Row Rendered event
		if ($this->RowType <> EW_ROWTYPE_AGGREGATEINIT)
			$this->Row_Rendered();
	}

	// Validate form
	function ValidateForm() {
		global $Language, $gsFormError;

		// Initialize form error message
		$gsFormError = "";

		// Check if validation required
		if (!EW_SERVER_VALIDATE)
			return ($gsFormError == "");
		if (!$this->Nombre->FldIsDetailKey && !is_null($this->Nombre->FormValue) && $this->Nombre->FormValue == "") {
			ew_AddMessage($gsFormError, $Language->Phrase("EnterRequiredField") . " - " . $this->Nombre->FldCaption());
		}
		if (!$this->Apellido->FldIsDetailKey && !is_null($this->Apellido->FormValue) && $this->Apellido->FormValue == "") {
			ew_AddMessage($gsFormError, $Language->Phrase("EnterRequiredField") . " - " . $this->Apellido->FldCaption());
		}
		if (!$this->Dni->FldIsDetailKey && !is_null($this->Dni->FormValue) && $this->Dni->FormValue == "") {
			ew_AddMessage($gsFormError, $Language->Phrase("EnterRequiredField") . " - " . $this->Dni->FldCaption());
		}
		if (!ew_CheckEuroDate($this->FechaNacimiento->FormValue)) {
			ew_AddMessage($gsFormError, $this->FechaNacimiento->FldErrMsg());
		}
		if (!ew_CheckInteger($this->Provincia->FormValue)) {
			ew_AddMessage($gsFormError, $this->Provincia->FldErrMsg());
		}
		if (!ew_CheckInteger($this->Localidad->FormValue)) {
			ew_AddMessage($gsFormError, $this->Localidad->FldErrMsg());
		}
		if (!ew_CheckInteger($this->NivelMorosidad->FormValue)) {
			ew_AddMessage($gsFormError, $this->NivelMorosidad->FldErrMsg());
		}
		if (!ew_CheckNumber($this->LimiteCredito->FormValue)) {
			ew_AddMessage($gsFormError, $this->LimiteCredito->FldErrMsg());
		}
		if (!ew_CheckNumber($this->LimiteContado->FormValue)) {
			ew_AddMessage($gsFormError, $this->LimiteContado->FldErrMsg());
		}
		if (!ew_CheckInteger($this->TipoCliente->FormValue)) {
			ew_AddMessage($gsFormError, $this->TipoCliente->FldErrMsg());
		}
		if (!ew_CheckInteger($this->Habilitacion->FormValue)) {
			ew_AddMessage($gsFormError, $this->Habilitacion->FldErrMsg());
		}
		if (!ew_CheckNumber($this->IngresoMensual->FormValue)) {
			ew_AddMessage($gsFormError, $this->IngresoMensual->FldErrMsg());
		}
		if (!ew_CheckNumber($this->CodigoAutorizacionSMS->FormValue)) {
			ew_AddMessage($gsFormError, $this->CodigoAutorizacionSMS->FldErrMsg());
		}

		// Return validate result
		$ValidateForm = ($gsFormError == "");

		// Call Form_CustomValidate event
		$sFormCustomError = "";
		$ValidateForm = $ValidateForm && $this->Form_CustomValidate($sFormCustomError);
		if ($sFormCustomError <> "") {
			ew_AddMessage($gsFormError, $sFormCustomError);
		}
		return $ValidateForm;
	}

	// Update record based on key values
	function EditRow() {
		global $conn, $Security, $Language;
		$sFilter = $this->KeyFilter();
		$this->CurrentFilter = $sFilter;
		$sSql = $this->SQL();
		$conn->raiseErrorFn = 'ew_ErrorFn';
		$rs = $conn->Execute($sSql);
		$conn->raiseErrorFn = '';
		if ($rs === FALSE)
			return FALSE;
		if ($rs->EOF) {
			$EditRow = FALSE; // Update Failed
		} else {

			// Save old values
			$rsold = &$rs->fields;
			$this->LoadDbValues($rsold);
			$rsnew = array();

			// Nombre
			$this->Nombre->SetDbValueDef($rsnew, $this->Nombre->CurrentValue, "", $this->Nombre->ReadOnly);

			// Apellido
			$this->Apellido->SetDbValueDef($rsnew, $this->Apellido->CurrentValue, "", $this->Apellido->ReadOnly);

			// Dni
			$this->Dni->SetDbValueDef($rsnew, $this->Dni->CurrentValue, "", $this->Dni->ReadOnly);

			// Calle
			$this->Calle->SetDbValueDef($rsnew, $this->Calle->CurrentValue, NULL, $this->Calle->ReadOnly);

			// Numero
			$this->Numero->SetDbValueDef($rsnew, $this->Numero->CurrentValue, NULL, $this->Numero->ReadOnly);

			// Piso
			$this->Piso->SetDbValueDef($rsnew, $this->Piso->CurrentValue, NULL, $this->Piso->ReadOnly);

			// Dpto
			$this->Dpto->SetDbValueDef($rsnew, $this->Dpto->CurrentValue, NULL, $this->Dpto->ReadOnly);

			// EntreCalles
			$this->EntreCalles->SetDbValueDef($rsnew, $this->EntreCalles->CurrentValue, NULL, $this->EntreCalles->ReadOnly);

			// TelCel
			$this->TelCel->SetDbValueDef($rsnew, $this->TelCel->CurrentValue, NULL, $this->TelCel->ReadOnly);

			// TelFijo
			$this->TelFijo->SetDbValueDef($rsnew, $this->TelFijo->CurrentValue, NULL, $this->TelFijo->ReadOnly);

			// TelVecino
			$this->TelVecino->SetDbValueDef($rsnew, $this->TelVecino->CurrentValue, NULL, $this->TelVecino->ReadOnly);

			// Email
			$this->_Email->SetDbValueDef($rsnew, $this->_Email->CurrentValue, NULL, $this->_Email->ReadOnly);

			// FechaNacimiento
			$this->FechaNacimiento->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->FechaNacimiento->CurrentValue, 7), NULL, $this->FechaNacimiento->ReadOnly);

			// Provincia
			$this->Provincia->SetDbValueDef($rsnew, $this->Provincia->CurrentValue, NULL, $this->Provincia->ReadOnly);

			// Localidad
			$this->Localidad->SetDbValueDef($rsnew, $this->Localidad->CurrentValue, NULL, $this->Localidad->ReadOnly);

			// CP
			$this->CP->SetDbValueDef($rsnew, $this->CP->CurrentValue, NULL, $this->CP->ReadOnly);

			// NivelMorosidad
			$this->NivelMorosidad->SetDbValueDef($rsnew, $this->NivelMorosidad->CurrentValue, NULL, $this->NivelMorosidad->ReadOnly);

			// LimiteCredito
			$this->LimiteCredito->SetDbValueDef($rsnew, $this->LimiteCredito->CurrentValue, NULL, $this->LimiteCredito->ReadOnly);

			// LimiteContado
			$this->LimiteContado->SetDbValueDef($rsnew, $this->LimiteContado->CurrentValue, NULL, $this->LimiteContado->ReadOnly);

			// TipoCliente
			$this->TipoCliente->SetDbValueDef($rsnew, $this->TipoCliente->CurrentValue, NULL, $this->TipoCliente->ReadOnly);

			// Habilitacion
			$this->Habilitacion->SetDbValueDef($rsnew, $this->Habilitacion->CurrentValue, NULL, $this->Habilitacion->ReadOnly);

			// IngresoMensual
			$this->IngresoMensual->SetDbValueDef($rsnew, $this->IngresoMensual->CurrentValue, NULL, $this->IngresoMensual->ReadOnly);

			// CodigoAutorizacionSMS
			$this->CodigoAutorizacionSMS->SetDbValueDef($rsnew, $this->CodigoAutorizacionSMS->CurrentValue, NULL, $this->CodigoAutorizacionSMS->ReadOnly);

			// Call Row Updating event
			$bUpdateRow = $this->Row_Updating($rsold, $rsnew);
			if ($bUpdateRow) {
				$conn->raiseErrorFn = 'ew_ErrorFn';
				if (count($rsnew) > 0)
					$EditRow = $this->Update($rsnew, "", $rsold);
				else
					$EditRow = TRUE; // No field to update
				$conn->raiseErrorFn = '';
				if ($EditRow) {
				}
			} else {
				if ($this->getSuccessMessage() <> "" || $this->getFailureMessage() <> "") {

					// Use the message, do nothing
				} elseif ($this->CancelMessage <> "") {
					$this->setFailureMessage($this->CancelMessage);
					$this->CancelMessage = "";
				} else {
					$this->setFailureMessage($Language->Phrase("UpdateCancelled"));
				}
				$EditRow = FALSE;
			}
		}

		// Call Row_Updated event
		if ($EditRow)
			$this->Row_Updated($rsold, $rsnew);
		$rs->Close();
		return $EditRow;
	}

	// Set up Breadcrumb
	function SetupBreadcrumb() {
		global $Breadcrumb, $Language;
		$Breadcrumb = new cBreadcrumb();
		$Breadcrumb->Add("list", $this->TableVar, "clienteslist.php", $this->TableVar, TRUE);
		$PageId = "edit";
		$Breadcrumb->Add("edit", $PageId, ew_CurrentUrl());
	}

	// Page Load event
	function Page_Load() {

		//echo "Page Load";
	}

	// Page Unload event
	function Page_Unload() {

		//echo "Page Unload";
	}

	// Page Redirecting event
	function Page_Redirecting(&$url) {

		// Example:
		//$url = "your URL";

	}

	// Message Showing event
	// $type = ''|'success'|'failure'|'warning'
	function Message_Showing(&$msg, $type) {
		if ($type == 'success') {

			//$msg = "your success message";
		} elseif ($type == 'failure') {

			//$msg = "your failure message";
		} elseif ($type == 'warning') {

			//$msg = "your warning message";
		} else {

			//$msg = "your message";
		}
	}

	// Page Render event
	function Page_Render() {

		//echo "Page Render";
	}

	// Page Data Rendering event
	function Page_DataRendering(&$header) {

		// Example:
		//$header = "your header";

	}

	// Page Data Rendered event
	function Page_DataRendered(&$footer) {

		// Example:
		//$footer = "your footer";

	}

	// Form Custom Validate event
	function Form_CustomValidate(&$CustomError) {

		// Return error message in CustomError
		return TRUE;
	}
}
?>
<?php ew_Header(FALSE) ?>
<?php

// Create page object
if (!isset($clientes_edit)) $clientes_edit = new cclientes_edit();

// Page init
$clientes_edit->Page_Init();

// Page main
$clientes_edit->Page_Main();

// Global Page Rendering event (in userfn*.php)
Page_Rendering();

// Page Rendering event
$clientes_edit->Page_Render();
?>
<?php include_once "header.php" ?>
<script type="text/javascript">

// Page object
var clientes_edit = new ew_Page("clientes_edit");
clientes_edit.PageID = "edit"; // Page ID
var EW_PAGE_ID = clientes_edit.PageID; // For backward compatibility

// Form object
var fclientesedit = new ew_Form("fclientesedit");

// Validate form
fclientesedit.Validate = function() {
	if (!this.ValidateRequired)
		return true; // Ignore validation
	var $ = jQuery, fobj = this.GetForm(), $fobj = $(fobj);
	this.PostAutoSuggest();
	if ($fobj.find("#a_confirm").val() == "F")
		return true;
	var elm, felm, uelm, addcnt = 0;
	var $k = $fobj.find("#" + this.FormKeyCountName); // Get key_count
	var rowcnt = ($k[0]) ? parseInt($k.val(), 10) : 1;
	var startcnt = (rowcnt == 0) ? 0 : 1; // Check rowcnt == 0 => Inline-Add
	var gridinsert = $fobj.find("#a_list").val() == "gridinsert";
	for (var i = startcnt; i <= rowcnt; i++) {
		var infix = ($k[0]) ? String(i) : "";
		$fobj.data("rowindex", infix);
			elm = this.GetElements("x" + infix + "_Nombre");
			if (elm && !ew_HasValue(elm))
				return this.OnError(elm, ewLanguage.Phrase("EnterRequiredField") + " - <?php echo ew_JsEncode2($clientes->Nombre->FldCaption()) ?>");
			elm = this.GetElements("x" + infix + "_Apellido");
			if (elm && !ew_HasValue(elm))
				return this.OnError(elm, ewLanguage.Phrase("EnterRequiredField") + " - <?php echo ew_JsEncode2($clientes->Apellido->FldCaption()) ?>");
			elm = this.GetElements("x" + infix + "_Dni");
			if (elm && !ew_HasValue(elm))
				return this.OnError(elm, ewLanguage.Phrase("EnterRequiredField") + " - <?php echo ew_JsEncode2($clientes->Dni->FldCaption()) ?>");
			elm = this.GetElements("x" + infix + "_FechaNacimiento");
			if (elm && !ew_CheckEuroDate(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($clientes->FechaNacimiento->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_Provincia");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($clientes->Provincia->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_Localidad");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($clientes->Localidad->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_NivelMorosidad");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($clientes->NivelMorosidad->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_LimiteCredito");
			if (elm && !ew_CheckNumber(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($clientes->LimiteCredito->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_LimiteContado");
			if (elm && !ew_CheckNumber(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($clientes->LimiteContado->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_TipoCliente");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($clientes->TipoCliente->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_Habilitacion");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($clientes->Habilitacion->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_IngresoMensual");
			if (elm && !ew_CheckNumber(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($clientes->IngresoMensual->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_CodigoAutorizacionSMS");
			if (elm && !ew_CheckNumber(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($clientes->CodigoAutorizacionSMS->FldErrMsg()) ?>");

			// Set up row object
			ew_ElementsToRow(fobj);

			// Fire Form_CustomValidate event
			if (!this.Form_CustomValidate(fobj))
				return false;
	}

	// Process detail forms
	var dfs = $fobj.find("input[name='detailpage']").get();
	for (var i = 0; i < dfs.length; i++) {
		var df = dfs[i], val = df.value;
		if (val && ewForms[val])
			if (!ewForms[val].Validate())
				return false;
	}
	return true;
}

// Form_CustomValidate event
fclientesedit.Form_CustomValidate = 
 function(fobj) { // DO NOT CHANGE THIS LINE!

 	// Your custom validation code here, return false if invalid. 
 	return true;
 }

// Use JavaScript validation or not
<?php if (EW_CLIENT_VALIDATE) { ?>
fclientesedit.ValidateRequired = true;
<?php } else { ?>
fclientesedit.ValidateRequired = false; 
<?php } ?>

// Dynamic selection lists
// Form object for search

</script>
<script type="text/javascript">

// Write your client script here, no need to add script tags.
</script>
<?php $Breadcrumb->Render(); ?>
<?php $clientes_edit->ShowPageHeader(); ?>
<?php
$clientes_edit->ShowMessage();
?>
<form name="fclientesedit" id="fclientesedit" class="ewForm form-inline" action="<?php echo ew_CurrentPage() ?>" method="post">
<input type="hidden" name="t" value="clientes">
<input type="hidden" name="a_edit" id="a_edit" value="U">
<table class="ewGrid"><tr><td>
<table id="tbl_clientesedit" class="table table-bordered table-striped">
<?php if ($clientes->id->Visible) { // id ?>
	<tr id="r_id">
		<td><span id="elh_clientes_id"><?php echo $clientes->id->FldCaption() ?></span></td>
		<td<?php echo $clientes->id->CellAttributes() ?>>
<span id="el_clientes_id" class="control-group">
<span<?php echo $clientes->id->ViewAttributes() ?>>
<?php echo $clientes->id->EditValue ?></span>
</span>
<input type="hidden" data-field="x_id" name="x_id" id="x_id" value="<?php echo ew_HtmlEncode($clientes->id->CurrentValue) ?>">
<?php echo $clientes->id->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->Nombre->Visible) { // Nombre ?>
	<tr id="r_Nombre">
		<td><span id="elh_clientes_Nombre"><?php echo $clientes->Nombre->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></span></td>
		<td<?php echo $clientes->Nombre->CellAttributes() ?>>
<span id="el_clientes_Nombre" class="control-group">
<input type="text" data-field="x_Nombre" name="x_Nombre" id="x_Nombre" size="30" maxlength="100" placeholder="<?php echo ew_HtmlEncode($clientes->Nombre->PlaceHolder) ?>" value="<?php echo $clientes->Nombre->EditValue ?>"<?php echo $clientes->Nombre->EditAttributes() ?>>
</span>
<?php echo $clientes->Nombre->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->Apellido->Visible) { // Apellido ?>
	<tr id="r_Apellido">
		<td><span id="elh_clientes_Apellido"><?php echo $clientes->Apellido->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></span></td>
		<td<?php echo $clientes->Apellido->CellAttributes() ?>>
<span id="el_clientes_Apellido" class="control-group">
<input type="text" data-field="x_Apellido" name="x_Apellido" id="x_Apellido" size="30" maxlength="100" placeholder="<?php echo ew_HtmlEncode($clientes->Apellido->PlaceHolder) ?>" value="<?php echo $clientes->Apellido->EditValue ?>"<?php echo $clientes->Apellido->EditAttributes() ?>>
</span>
<?php echo $clientes->Apellido->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->Dni->Visible) { // Dni ?>
	<tr id="r_Dni">
		<td><span id="elh_clientes_Dni"><?php echo $clientes->Dni->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></span></td>
		<td<?php echo $clientes->Dni->CellAttributes() ?>>
<span id="el_clientes_Dni" class="control-group">
<input type="text" data-field="x_Dni" name="x_Dni" id="x_Dni" size="30" maxlength="16" placeholder="<?php echo ew_HtmlEncode($clientes->Dni->PlaceHolder) ?>" value="<?php echo $clientes->Dni->EditValue ?>"<?php echo $clientes->Dni->EditAttributes() ?>>
</span>
<?php echo $clientes->Dni->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->Calle->Visible) { // Calle ?>
	<tr id="r_Calle">
		<td><span id="elh_clientes_Calle"><?php echo $clientes->Calle->FldCaption() ?></span></td>
		<td<?php echo $clientes->Calle->CellAttributes() ?>>
<span id="el_clientes_Calle" class="control-group">
<input type="text" data-field="x_Calle" name="x_Calle" id="x_Calle" size="30" maxlength="100" placeholder="<?php echo ew_HtmlEncode($clientes->Calle->PlaceHolder) ?>" value="<?php echo $clientes->Calle->EditValue ?>"<?php echo $clientes->Calle->EditAttributes() ?>>
</span>
<?php echo $clientes->Calle->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->Numero->Visible) { // Numero ?>
	<tr id="r_Numero">
		<td><span id="elh_clientes_Numero"><?php echo $clientes->Numero->FldCaption() ?></span></td>
		<td<?php echo $clientes->Numero->CellAttributes() ?>>
<span id="el_clientes_Numero" class="control-group">
<input type="text" data-field="x_Numero" name="x_Numero" id="x_Numero" size="30" maxlength="10" placeholder="<?php echo ew_HtmlEncode($clientes->Numero->PlaceHolder) ?>" value="<?php echo $clientes->Numero->EditValue ?>"<?php echo $clientes->Numero->EditAttributes() ?>>
</span>
<?php echo $clientes->Numero->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->Piso->Visible) { // Piso ?>
	<tr id="r_Piso">
		<td><span id="elh_clientes_Piso"><?php echo $clientes->Piso->FldCaption() ?></span></td>
		<td<?php echo $clientes->Piso->CellAttributes() ?>>
<span id="el_clientes_Piso" class="control-group">
<input type="text" data-field="x_Piso" name="x_Piso" id="x_Piso" size="30" maxlength="10" placeholder="<?php echo ew_HtmlEncode($clientes->Piso->PlaceHolder) ?>" value="<?php echo $clientes->Piso->EditValue ?>"<?php echo $clientes->Piso->EditAttributes() ?>>
</span>
<?php echo $clientes->Piso->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->Dpto->Visible) { // Dpto ?>
	<tr id="r_Dpto">
		<td><span id="elh_clientes_Dpto"><?php echo $clientes->Dpto->FldCaption() ?></span></td>
		<td<?php echo $clientes->Dpto->CellAttributes() ?>>
<span id="el_clientes_Dpto" class="control-group">
<input type="text" data-field="x_Dpto" name="x_Dpto" id="x_Dpto" size="30" maxlength="20" placeholder="<?php echo ew_HtmlEncode($clientes->Dpto->PlaceHolder) ?>" value="<?php echo $clientes->Dpto->EditValue ?>"<?php echo $clientes->Dpto->EditAttributes() ?>>
</span>
<?php echo $clientes->Dpto->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->EntreCalles->Visible) { // EntreCalles ?>
	<tr id="r_EntreCalles">
		<td><span id="elh_clientes_EntreCalles"><?php echo $clientes->EntreCalles->FldCaption() ?></span></td>
		<td<?php echo $clientes->EntreCalles->CellAttributes() ?>>
<span id="el_clientes_EntreCalles" class="control-group">
<input type="text" data-field="x_EntreCalles" name="x_EntreCalles" id="x_EntreCalles" size="30" maxlength="100" placeholder="<?php echo ew_HtmlEncode($clientes->EntreCalles->PlaceHolder) ?>" value="<?php echo $clientes->EntreCalles->EditValue ?>"<?php echo $clientes->EntreCalles->EditAttributes() ?>>
</span>
<?php echo $clientes->EntreCalles->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->TelCel->Visible) { // TelCel ?>
	<tr id="r_TelCel">
		<td><span id="elh_clientes_TelCel"><?php echo $clientes->TelCel->FldCaption() ?></span></td>
		<td<?php echo $clientes->TelCel->CellAttributes() ?>>
<span id="el_clientes_TelCel" class="control-group">
<input type="text" data-field="x_TelCel" name="x_TelCel" id="x_TelCel" size="30" maxlength="40" placeholder="<?php echo ew_HtmlEncode($clientes->TelCel->PlaceHolder) ?>" value="<?php echo $clientes->TelCel->EditValue ?>"<?php echo $clientes->TelCel->EditAttributes() ?>>
</span>
<?php echo $clientes->TelCel->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->TelFijo->Visible) { // TelFijo ?>
	<tr id="r_TelFijo">
		<td><span id="elh_clientes_TelFijo"><?php echo $clientes->TelFijo->FldCaption() ?></span></td>
		<td<?php echo $clientes->TelFijo->CellAttributes() ?>>
<span id="el_clientes_TelFijo" class="control-group">
<input type="text" data-field="x_TelFijo" name="x_TelFijo" id="x_TelFijo" size="30" maxlength="40" placeholder="<?php echo ew_HtmlEncode($clientes->TelFijo->PlaceHolder) ?>" value="<?php echo $clientes->TelFijo->EditValue ?>"<?php echo $clientes->TelFijo->EditAttributes() ?>>
</span>
<?php echo $clientes->TelFijo->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->TelVecino->Visible) { // TelVecino ?>
	<tr id="r_TelVecino">
		<td><span id="elh_clientes_TelVecino"><?php echo $clientes->TelVecino->FldCaption() ?></span></td>
		<td<?php echo $clientes->TelVecino->CellAttributes() ?>>
<span id="el_clientes_TelVecino" class="control-group">
<input type="text" data-field="x_TelVecino" name="x_TelVecino" id="x_TelVecino" size="30" maxlength="40" placeholder="<?php echo ew_HtmlEncode($clientes->TelVecino->PlaceHolder) ?>" value="<?php echo $clientes->TelVecino->EditValue ?>"<?php echo $clientes->TelVecino->EditAttributes() ?>>
</span>
<?php echo $clientes->TelVecino->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->_Email->Visible) { // Email ?>
	<tr id="r__Email">
		<td><span id="elh_clientes__Email"><?php echo $clientes->_Email->FldCaption() ?></span></td>
		<td<?php echo $clientes->_Email->CellAttributes() ?>>
<span id="el_clientes__Email" class="control-group">
<input type="text" data-field="x__Email" name="x__Email" id="x__Email" size="30" maxlength="100" placeholder="<?php echo ew_HtmlEncode($clientes->_Email->PlaceHolder) ?>" value="<?php echo $clientes->_Email->EditValue ?>"<?php echo $clientes->_Email->EditAttributes() ?>>
</span>
<?php echo $clientes->_Email->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->FechaNacimiento->Visible) { // FechaNacimiento ?>
	<tr id="r_FechaNacimiento">
		<td><span id="elh_clientes_FechaNacimiento"><?php echo $clientes->FechaNacimiento->FldCaption() ?></span></td>
		<td<?php echo $clientes->FechaNacimiento->CellAttributes() ?>>
<span id="el_clientes_FechaNacimiento" class="control-group">
<input type="text" data-field="x_FechaNacimiento" name="x_FechaNacimiento" id="x_FechaNacimiento" placeholder="<?php echo ew_HtmlEncode($clientes->FechaNacimiento->PlaceHolder) ?>" value="<?php echo $clientes->FechaNacimiento->EditValue ?>"<?php echo $clientes->FechaNacimiento->EditAttributes() ?>>
</span>
<?php echo $clientes->FechaNacimiento->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->Provincia->Visible) { // Provincia ?>
	<tr id="r_Provincia">
		<td><span id="elh_clientes_Provincia"><?php echo $clientes->Provincia->FldCaption() ?></span></td>
		<td<?php echo $clientes->Provincia->CellAttributes() ?>>
<span id="el_clientes_Provincia" class="control-group">
<input type="text" data-field="x_Provincia" name="x_Provincia" id="x_Provincia" size="30" placeholder="<?php echo ew_HtmlEncode($clientes->Provincia->PlaceHolder) ?>" value="<?php echo $clientes->Provincia->EditValue ?>"<?php echo $clientes->Provincia->EditAttributes() ?>>
</span>
<?php echo $clientes->Provincia->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->Localidad->Visible) { // Localidad ?>
	<tr id="r_Localidad">
		<td><span id="elh_clientes_Localidad"><?php echo $clientes->Localidad->FldCaption() ?></span></td>
		<td<?php echo $clientes->Localidad->CellAttributes() ?>>
<span id="el_clientes_Localidad" class="control-group">
<input type="text" data-field="x_Localidad" name="x_Localidad" id="x_Localidad" size="30" placeholder="<?php echo ew_HtmlEncode($clientes->Localidad->PlaceHolder) ?>" value="<?php echo $clientes->Localidad->EditValue ?>"<?php echo $clientes->Localidad->EditAttributes() ?>>
</span>
<?php echo $clientes->Localidad->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->CP->Visible) { // CP ?>
	<tr id="r_CP">
		<td><span id="elh_clientes_CP"><?php echo $clientes->CP->FldCaption() ?></span></td>
		<td<?php echo $clientes->CP->CellAttributes() ?>>
<span id="el_clientes_CP" class="control-group">
<input type="text" data-field="x_CP" name="x_CP" id="x_CP" size="30" maxlength="20" placeholder="<?php echo ew_HtmlEncode($clientes->CP->PlaceHolder) ?>" value="<?php echo $clientes->CP->EditValue ?>"<?php echo $clientes->CP->EditAttributes() ?>>
</span>
<?php echo $clientes->CP->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->NivelMorosidad->Visible) { // NivelMorosidad ?>
	<tr id="r_NivelMorosidad">
		<td><span id="elh_clientes_NivelMorosidad"><?php echo $clientes->NivelMorosidad->FldCaption() ?></span></td>
		<td<?php echo $clientes->NivelMorosidad->CellAttributes() ?>>
<span id="el_clientes_NivelMorosidad" class="control-group">
<input type="text" data-field="x_NivelMorosidad" name="x_NivelMorosidad" id="x_NivelMorosidad" size="30" placeholder="<?php echo ew_HtmlEncode($clientes->NivelMorosidad->PlaceHolder) ?>" value="<?php echo $clientes->NivelMorosidad->EditValue ?>"<?php echo $clientes->NivelMorosidad->EditAttributes() ?>>
</span>
<?php echo $clientes->NivelMorosidad->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->LimiteCredito->Visible) { // LimiteCredito ?>
	<tr id="r_LimiteCredito">
		<td><span id="elh_clientes_LimiteCredito"><?php echo $clientes->LimiteCredito->FldCaption() ?></span></td>
		<td<?php echo $clientes->LimiteCredito->CellAttributes() ?>>
<span id="el_clientes_LimiteCredito" class="control-group">
<input type="text" data-field="x_LimiteCredito" name="x_LimiteCredito" id="x_LimiteCredito" size="30" placeholder="<?php echo ew_HtmlEncode($clientes->LimiteCredito->PlaceHolder) ?>" value="<?php echo $clientes->LimiteCredito->EditValue ?>"<?php echo $clientes->LimiteCredito->EditAttributes() ?>>
</span>
<?php echo $clientes->LimiteCredito->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->LimiteContado->Visible) { // LimiteContado ?>
	<tr id="r_LimiteContado">
		<td><span id="elh_clientes_LimiteContado"><?php echo $clientes->LimiteContado->FldCaption() ?></span></td>
		<td<?php echo $clientes->LimiteContado->CellAttributes() ?>>
<span id="el_clientes_LimiteContado" class="control-group">
<input type="text" data-field="x_LimiteContado" name="x_LimiteContado" id="x_LimiteContado" size="30" placeholder="<?php echo ew_HtmlEncode($clientes->LimiteContado->PlaceHolder) ?>" value="<?php echo $clientes->LimiteContado->EditValue ?>"<?php echo $clientes->LimiteContado->EditAttributes() ?>>
</span>
<?php echo $clientes->LimiteContado->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->TipoCliente->Visible) { // TipoCliente ?>
	<tr id="r_TipoCliente">
		<td><span id="elh_clientes_TipoCliente"><?php echo $clientes->TipoCliente->FldCaption() ?></span></td>
		<td<?php echo $clientes->TipoCliente->CellAttributes() ?>>
<span id="el_clientes_TipoCliente" class="control-group">
<input type="text" data-field="x_TipoCliente" name="x_TipoCliente" id="x_TipoCliente" size="30" placeholder="<?php echo ew_HtmlEncode($clientes->TipoCliente->PlaceHolder) ?>" value="<?php echo $clientes->TipoCliente->EditValue ?>"<?php echo $clientes->TipoCliente->EditAttributes() ?>>
</span>
<?php echo $clientes->TipoCliente->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->Habilitacion->Visible) { // Habilitacion ?>
	<tr id="r_Habilitacion">
		<td><span id="elh_clientes_Habilitacion"><?php echo $clientes->Habilitacion->FldCaption() ?></span></td>
		<td<?php echo $clientes->Habilitacion->CellAttributes() ?>>
<span id="el_clientes_Habilitacion" class="control-group">
<input type="text" data-field="x_Habilitacion" name="x_Habilitacion" id="x_Habilitacion" size="30" placeholder="<?php echo ew_HtmlEncode($clientes->Habilitacion->PlaceHolder) ?>" value="<?php echo $clientes->Habilitacion->EditValue ?>"<?php echo $clientes->Habilitacion->EditAttributes() ?>>
</span>
<?php echo $clientes->Habilitacion->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->IngresoMensual->Visible) { // IngresoMensual ?>
	<tr id="r_IngresoMensual">
		<td><span id="elh_clientes_IngresoMensual"><?php echo $clientes->IngresoMensual->FldCaption() ?></span></td>
		<td<?php echo $clientes->IngresoMensual->CellAttributes() ?>>
<span id="el_clientes_IngresoMensual" class="control-group">
<input type="text" data-field="x_IngresoMensual" name="x_IngresoMensual" id="x_IngresoMensual" size="30" placeholder="<?php echo ew_HtmlEncode($clientes->IngresoMensual->PlaceHolder) ?>" value="<?php echo $clientes->IngresoMensual->EditValue ?>"<?php echo $clientes->IngresoMensual->EditAttributes() ?>>
</span>
<?php echo $clientes->IngresoMensual->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php if ($clientes->CodigoAutorizacionSMS->Visible) { // CodigoAutorizacionSMS ?>
	<tr id="r_CodigoAutorizacionSMS">
		<td><span id="elh_clientes_CodigoAutorizacionSMS"><?php echo $clientes->CodigoAutorizacionSMS->FldCaption() ?></span></td>
		<td<?php echo $clientes->CodigoAutorizacionSMS->CellAttributes() ?>>
<span id="el_clientes_CodigoAutorizacionSMS" class="control-group">
<input type="text" data-field="x_CodigoAutorizacionSMS" name="x_CodigoAutorizacionSMS" id="x_CodigoAutorizacionSMS" size="30" placeholder="<?php echo ew_HtmlEncode($clientes->CodigoAutorizacionSMS->PlaceHolder) ?>" value="<?php echo $clientes->CodigoAutorizacionSMS->EditValue ?>"<?php echo $clientes->CodigoAutorizacionSMS->EditAttributes() ?>>
</span>
<?php echo $clientes->CodigoAutorizacionSMS->CustomMsg ?></td>
	</tr>
<?php } ?>
</table>
</td></tr></table>
<button class="btn btn-primary ewButton" name="btnAction" id="btnAction" type="submit"><?php echo $Language->Phrase("EditBtn") ?></button>
</form>
<script type="text/javascript">
fclientesedit.Init();
<?php if (EW_MOBILE_REFLOW && ew_IsMobile()) { ?>
ew_Reflow();
<?php } ?>
</script>
<?php
$clientes_edit->ShowPageFooter();
if (EW_DEBUG_ENABLED)
	echo ew_DebugMsg();
?>
<script type="text/javascript">

// Write your table-specific startup script here
// document.write("page loaded");

</script>
<?php include_once "footer.php" ?>
<?php
$clientes_edit->Page_Terminate();
?>
